package com.it.service.impl;

import com.github.pagehelper.PageHelper;
import com.it.dao.BillsDao;
import com.it.domain.Bills;
import com.it.service.BillsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
@Service("BillsService")
public class BillsServiceImpl implements BillsService {
    @Autowired
    private BillsDao billsDao;
    /**
     * 查询所有Bills账单
     * @return
     */
    @Override
    public List<Bills> FindAllBills(int page,int size) {
        PageHelper.startPage(page,size);
        return billsDao.FindAllBills(page, size);
    }
    /**
     * 查询所有Bills账单
     * @return
     */
    @Override
    public List<Bills> FindAllBills1() {
        return billsDao.FindAllBills1();
    }

    /**
     * 插入消息
     * @param bills
     */
    @Override
    public void insertBills(Bills bills) {
         billsDao.insertBills(bills);
    }

    /**
     * 根据日期查询bills
     * @param date01
     * @param date02
     * @param page
     * @param size
     * @return
     */
    @Override
    public List<Bills> findBillsDate(Date date01, Date date02, int page, int size) {
        PageHelper.startPage(page,size);
        return billsDao.findBillsDate(date01, date02,page,size);
    }

    /**
     * 根据日期查询bills
     * @param date01
     * @param date02
     * @return
     */
    @Override
    public List<Bills> findBillsDate1(Date date01, Date date02) {
        return billsDao.findBillsDate1(date01,date02);
    }
}
